#include<stdio.h>
int main()
{
	int x = 0,y = 0;
	scanf("%d%d",&x,&y);
	   printf("%d ", gcd(x,y));
	   lcm(x,y);
	  printf("%d", lcm(x,y));
	return 0;
}

 int gcd(int a,int b)
 {
 	while(b != 0)
 	{
 		int temp = b;
 		b = a%b;
		 a =temp; 
	 }
 	 return a;
 }
  int lcm(int a,int b)
	   {
	   	 if(a ==0||b==0)
	   	 {
	   	 	return 0;
			}
			else{
				return abs((a*b)/gcd(a,b));
			}
	   	
	   }
